#ifndef POSTITEMWIDGET_H
#define POSTITEMWIDGET_H

#include <QApplication>
#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QListWidget>
#include <QListWidgetItem>
#include <QLabel>
#include <QTextEdit>
#include <QLineEdit>
#include <QComboBox>
#include <QSpinBox>
#include <QStackedWidget>
#include <QAction>
#include <QToolBar>
#include <QStatusBar>
#include <QFileDialog>
#include <QPixmap>
#include <QStyleFactory>
#include <QDateTime>
#include <QMessageBox>

namespace Ui {
class PostItemWidget;
}

class PostItemWidget : public QWidget
{
    Q_OBJECT

public:
    explicit PostItemWidget(QWidget *parent = nullptr);
    ~PostItemWidget();

    void setPostData(const QString &author, const QString &titleContent,
                     const QString &plantType, float price, const QString &imagePath = "");

    QString getAuthor() const { return author; }
    QString getTitle() const { return title; }
    QString getContent() const { return content; }
    QString getPlantType() const { return plantType; }
    float getPrice() const { return price; }
    QString getImagePath() const { return imagePath; }

signals:
    void avatarChanged(const QString &path);
    void nicknameChanged(const QString &name);

private:
    Ui::PostItemWidget *ui;

    QLabel *authorLabel;
    QLabel *timeLabel;
    QLabel *contentLabel;
    QLabel *imageLabel;
    QLabel *plantLabel;
    QLabel *priceLabel;

    QString author;
    QString title;
    QString content;
    QString plantType;
    float price;
    QString imagePath;
};

#endif // POSTITEMWIDGET_H
